//============================================================================
// Name        : Zen_test_v4.cpp
// Author      : BLUEnLIVE (http://TEUS.me)
// Version     : 1.0
// Copyright   : Copyright (c) 2012 by BLUEnLIVE
// Description : Zen_coding_v4 caller module in C++
//============================================================================

#include <iostream>
#include "zen_coding_v4.h"

using namespace std;

int main()
{
	//wchar_t *abbr = L"html:5>div#page>div#header>ul.navigation>li*4>a";
	//wchar_t *abbr = L"li*4";
	//wchar_t *abbr = L"div#page>div#header>ul.navigation>li*4>a";
	//wchar_t *abbr = L"  div#page>div.logo+ul#navigation>li*5>a  ";
	//wchar_t *abbr = L"div>div#page>p.title+p|c";
	//wchar_t *abbr = L"html>(head>title)>body>div#wrapper+div#footer";
	wchar_t *abbr = L"div#page>(div#header>ul#nav>li*4>a)+(div#page>(h1>span)+p*2)+div#footer";

	//wchar_t *abbr = L"tm>if>div.message";
	//wchar_t *abbr = L"ap>wp>call";

	wchar_t zen[2000];
	int size = iZenCodingConv(abbr, zen, 2000, zen_syntax_html, zen_profile_html, true, false);
	//int size = iZenCodingConv(abbr, zen, 2000, zen_syntax_xsl, zen_profile_xml, true, false);

	printf("result size: %d\n", size);
	if (size>0) {
		wprintf(L"%s\n", zen);
	}

	FILE *f;
	f = fopen("c:\\zen.out", "wb");
	fwrite((void*)zen, sizeof(wchar_t), size, f);
	fclose(f);

    return 0;
}
